﻿/****************************************
 *  copyright (c) 2008 leo shen
 *  
 *  all rights reserved         
 * 
 *  e-mail : syl.lucky@gmail.com
 * *************************************/

using System;
using System.Collections.Generic;
using System.Text;

namespace DotUpdater.Core
{
    /// <summary>
    /// A file system that the file or folder
    /// </summary>
    public abstract class App_FileORFolder
    {
        string m_name;

        public App_FileORFolder(string name)
        {
            m_name = name;
        }

        /// <summary>
        /// the file or folder name
        /// </summary>
        public string Name
        {
            get { return m_name; }
            set { m_name = value; }
        }

        public override bool Equals(object obj)
        {
            if (obj == null) return false;
            if (obj.GetType() != this.GetType()) return false;
            App_FileORFolder other = obj as App_FileORFolder;
            return this.Name.Equals(other.Name);
        }

        public override int GetHashCode()
        {
            return this.Name.GetHashCode();
        }
    }
}
